BUG: read_csv pyarrow engine ignored tuple names for MultiIndex columns#65925
Open
jbrockmendel wants to merge 2 commits into
Open
BUG: read_csv pyarrow engine ignored tuple names for MultiIndex columns#65925jbrockmendel wants to merge 2 commits into
jbrockmendel wants to merge 2 commits into
Conversation
Passing tuples in ``names`` to ``read_csv`` with ``engine="pyarrow"`` produced flat columns instead of MultiIndex columns like the other engines. Route the result columns through ``_maybe_make_multi_index_columns`` as the C/python engines do. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splits the tuple-
names→MultiIndexcolumns fix out of GH-65862 into a standalone, bite-size change.With
engine="pyarrow", passing tuples innamesproduced flat columns (anIndexof tuples) instead ofMultiIndexcolumns like the C and python engines:The fix routes the result columns through the same
_maybe_make_multi_index_columnshelper the C/python engines already use, so all engines now agree.arrow_parser_wrapper.py(no-op when columns aren't tuples)names-tuple parametrizations oftest_header_multi_index_common_format1/2/3— their blanket@xfail_pyarrowonly applied because the separateheader=[0, 1]parametrization raises; those now assert the correctMultiIndex, with the list-headervariant kept as a conditional xfail (that's a separate concern handled in BUG: raise helpful errors for unsupported pyarrow read_csv usage #65862)🤖 Generated with Claude Code